Exit remove_child_area when region is empty
authorAlexander Larsson <alexl@redhat.com>
Sun, 19 Jul 2009 20:36:43 +0000 (22:36 +0200)
committerAlexander Larsson <alexl@redhat.com>
Sun, 19 Jul 2009 20:38:06 +0000 (22:38 +0200)
When the region is empty we can return early, because there
is no more area to remove. This happens often for children
of scrolled windows (i.e. things that are clipped out.

gdk/gdkwindow.c

index a1fa4505df7222669814658f990a1a302f932dbc..3746a8f953a65d916e4b36e0f9ab72778d25aaf4 100644 (file)
@@ -623,6 +623,11 @@ remove_child_area (GdkWindowObject *private,
       if (child == until)
        break;
 
+      /* If region is empty already, no need to do
+        anything potentially costly */
+      if (gdk_region_empty (region))
+       break;
+
       if (!GDK_WINDOW_IS_MAPPED (child) || child->input_only || child->composited)
        continue;